**** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** ****
****
****
**** Replication code for Anna O. Pechenkina's "Third-Party Pressure for Peace"
**** International Interactions 
**** All analyses are made with Stata 14.2
****
****
**** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** ****

cd "/Users/ ..../Pechenkina_pressure_replication/" /*set your working directory*/
use "pressure.dta", replace

stset date1, id(id) failure(newwar) time0(date0) origin(time date0)

*****
*****
***** Fig 1A: histogram of failure times 
hist _t if newwar ==1, freq width(300) xtick(0(3650)22000) ///
 xlabel( 3650  7300  10950  14600  18250  21900) xsize(4) ///
 xtitle("Time (days) with 10-year intervals marked", size (3)) ytitle("Frequency", size(3)) scheme(plotplain)

*****
*****
***** Fig 1B: baseline hazard 
stcox contiguity,  hr   efron cluster(LHRcluster)

stcurve, haz noboundary xlabel( 3650  7300  10950  14600  18250  21900) ///
 xtitle("Time (days) with 10-year intervals marked", size (3)) ytitle("Smoothed hazard function", size(3)) ///
 title("") xsize(4) scheme(plotplain)


*****
*****
***** 
***** Table 1: Analysis of risk that ceasefire ends with a new war, 1914–2001 

stcox   thirdpartycfire    wernerFIRC  capchange battletide  index onedem5 twodem5 tie  cfhist lndeaths stakes contiguity if _t<3651, ///
tvc(wernerFIRC cfhist ) texp(ln(_t)) hr efron cluster(LHRcluster)
estimates store m1 

stcox  diplomat_threat econ_threat      wernerFIRC  capchange battletide   index onedem5 twodem5 tie  cfhist lndeaths stakes contiguity if _t<3651, ///
tvc(  wernerFIRC cfhist ) texp(ln(_t)) hr efron cluster(LHRcluster)
estimates store m2


stcox  diplomat_threat  mil_threat   wernerFIRC  capchange battletide   index onedem5 twodem5 tie  cfhist lndeaths stakes contiguity if _t<3651, ///
tvc(  wernerFIRC cfhist ) texp(ln(_t)) hr efron cluster(LHRcluster)
estimates store m3

stcox  dip_only dip_econ_only  mil_threat   wernerFIRC  capchange battletide   index onedem5 twodem5 tie  cfhist lndeaths stakes contiguity if _t<3651, ///
tvc(  wernerFIRC cfhist ) texp(ln(_t)) hr efron cluster(LHRcluster)
estimates store m4


stcox   thirdpartycfire    wernerFIRC  capchange battletide   index onedem5 twodem5 tie  cfhist lndeaths stakes contiguity , ///
tvc(wernerFIRC cfhist ) texp(ln(_t)) hr efron cluster(LHRcluster)
estimates store m5

stcox  diplomat_threat econ_threat      wernerFIRC  capchange battletide   index onedem5 twodem5 tie  cfhist lndeaths stakes contiguity , ///
tvc( wernerFIRC cfhist) texp(ln(_t)) hr efron cluster(LHRcluster)
estimates store m6

*****
***** Fig 2: KM 
sts graph if _t<15001, surv by (diplomat_threat)  ci legend(off) xsize(4) xtitle("Days") title("") scheme(plotplain)


stcox  diplomat_threat  mil_threat   wernerFIRC  capchange battletide   index onedem5 twodem5 tie  cfhist lndeaths stakes contiguity , ///
tvc(  wernerFIRC cfhist) texp(ln(_t)) hr efron cluster(LHRcluster)
estimates store m7


stcox  dip_only dip_econ_only   mil_threat   wernerFIRC  capchange battletide   index onedem5 twodem5 tie  cfhist lndeaths stakes contiguity , ///
tvc(  wernerFIRC cfhist) texp(ln(_t)) hr efron cluster(LHRcluster)
estimates store m8

esttab  m1   m2   m3  m4 m5 m6 m7 m8  ///
    using pressure_table1.tex, replace f ///
 	label booktabs margin se(3) eqlabels(none) alignment(S S) collabels("\multicolumn{1}{c}{$\beta$ / SE}") ///
	star(* 0.05 ** 0.01 ) pr2 aic 

	

*****
*****
***** 
***** Table 2: Differences in dyad characteristics and war recurrence between wars with third-party pressure for peace and wars without it  
 
 
clear
use "pressure_collapsed.dta"

** DIP PRESSURE

mat T = J(13,5,.)

ttest wernerFIRC  , by(diplomat_threat)
mat T[1,1] = r(mu_1)
mat T[1,2] = r(mu_2)
mat T[1,3] = r(mu_1) - r(mu_2)
mat T[1,4] = r(t)
mat T[1,5] = r(p)

ttest battletide , by(diplomat_threat)
mat T[2,1] = r(mu_1)
mat T[2,2] = r(mu_2)
mat T[2,3] = r(mu_1) - r(mu_2)
mat T[2,4] = r(t)
mat T[2,5] = r(p)

ttest tie , by(diplomat_threat) /*no mil*/

mat T[3,1] = r(mu_1)
mat T[3,2] = r(mu_2)
mat T[3,3] = r(mu_1) - r(mu_2)
mat T[3,4] = r(t)
mat T[3,5] = r(p)

ttest cfhist , by(diplomat_threat)
mat T[4,1] = r(mu_1)
mat T[4,2] = r(mu_2)
mat T[4,3] = r(mu_1) - r(mu_2)
mat T[4,4] = r(t)
mat T[4,5] = r(p)

ttest stakes , by(diplomat_threat)
mat T[5,1] = r(mu_1)
mat T[5,2] = r(mu_2)
mat T[5,3] = r(mu_1) - r(mu_2)
mat T[5,4] = r(t)
mat T[5,5] = r(p)

ttest contiguity , by(diplomat_threat)
mat T[6,1] = r(mu_1)
mat T[6,2] = r(mu_2)
mat T[6,3] = r(mu_1) - r(mu_2)
mat T[6,4] = r(t)
mat T[6,5] = r(p)

ttest  lndeaths , by(diplomat_threat)
mat T[7,1] = r(mu_1)
mat T[7,2] = r(mu_2)
mat T[7,3] = r(mu_1) - r(mu_2)
mat T[7,4] = r(t)
mat T[7,5] = r(p)

ttest   index_first , by(diplomat_threat)
mat T[8,1] = r(mu_1)
mat T[8,2] = r(mu_2)
mat T[8,3] = r(mu_1) - r(mu_2)
mat T[8,4] = r(t)
mat T[8,5] = r(p)

ttest  formal_first , by(diplomat_threat)
mat T[9,1] = r(mu_1)
mat T[9,2] = r(mu_2)
mat T[9,3] = r(mu_1) - r(mu_2)
mat T[9,4] = r(t)
mat T[9,5] = r(p)

ttest  onedem5_first , by(diplomat_threat)
mat T[10,1] = r(mu_1)
mat T[10,2] = r(mu_2)
mat T[10,3] = r(mu_1) - r(mu_2)
mat T[10,4] = r(t)
mat T[10,5] = r(p)

ttest  twodem5_first , by(diplomat_threat)
mat T[11,1] = r(mu_1)
mat T[11,2] = r(mu_2)
mat T[11,3] = r(mu_1) - r(mu_2)
mat T[11,4] = r(t)
mat T[11,5] = r(p)


ttest  multi , by(diplomat_threat)
mat T[12,1] = r(mu_1)
mat T[12,2] = r(mu_2)
mat T[12,3] = r(mu_1) - r(mu_2)
mat T[12,4] = r(t)
mat T[12,5] = r(p)

ttest  newwar , by(diplomat_threat)
mat T[13,1] = r(mu_1)
mat T[13,2] = r(mu_2)
mat T[13,3] = r(mu_1) - r(mu_2)
mat T[13,4] = r(t)
mat T[13,5] = r(p)

mat rownames T = "FIRC" "Battle consistency" "Tie" "History of conflict" ///
"Existence at stake"  "Contiguity" "ln(Deaths)" "Initial index" "Initial formalism" ///
"Initial one democracy" "Initial joint democracy"  "Multilateral war" "New war"

	frmttable using ttest.doc, statmat(T) varlabels replace ///
	ctitle("", No dip pressure , Dip pressure, Difference, t-statistic, p-value)

 
** ECON PRESSURE
mat T = J(13,5,.)

ttest wernerFIRC  , by(econ_threat)
mat T[1,1] = r(mu_1)
mat T[1,2] = r(mu_2)
mat T[1,3] = r(mu_1) - r(mu_2)
mat T[1,4] = r(t)
mat T[1,5] = r(p)

ttest battletide  , by(econ_threat)
mat T[2,1] = r(mu_1)
mat T[2,2] = r(mu_2)
mat T[2,3] = r(mu_1) - r(mu_2)
mat T[2,4] = r(t)
mat T[2,5] = r(p)

ttest tie  , by(econ_threat) /*no mil*/

mat T[3,1] = r(mu_1)
mat T[3,2] = r(mu_2)
mat T[3,3] = r(mu_1) - r(mu_2)
mat T[3,4] = r(t)
mat T[3,5] = r(p)

ttest cfhist  , by(econ_threat)
mat T[4,1] = r(mu_1)
mat T[4,2] = r(mu_2)
mat T[4,3] = r(mu_1) - r(mu_2)
mat T[4,4] = r(t)
mat T[4,5] = r(p)

ttest stakes  , by(econ_threat)
mat T[5,1] = r(mu_1)
mat T[5,2] = r(mu_2)
mat T[5,3] = r(mu_1) - r(mu_2)
mat T[5,4] = r(t)
mat T[5,5] = r(p)

ttest contiguity  , by(econ_threat)
mat T[6,1] = r(mu_1)
mat T[6,2] = r(mu_2)
mat T[6,3] = r(mu_1) - r(mu_2)
mat T[6,4] = r(t)
mat T[6,5] = r(p)

ttest  lndeaths  , by(econ_threat)
mat T[7,1] = r(mu_1)
mat T[7,2] = r(mu_2)
mat T[7,3] = r(mu_1) - r(mu_2)
mat T[7,4] = r(t)
mat T[7,5] = r(p)

ttest  index_first  , by(econ_threat)
mat T[8,1] = r(mu_1)
mat T[8,2] = r(mu_2)
mat T[8,3] = r(mu_1) - r(mu_2)
mat T[8,4] = r(t)
mat T[8,5] = r(p)

ttest  formal_first , by(econ_threat)
mat T[9,1] = r(mu_1)
mat T[9,2] = r(mu_2)
mat T[9,3] = r(mu_1) - r(mu_2)
mat T[9,4] = r(t)
mat T[9,5] = r(p)

ttest  onedem5_first  , by(econ_threat)
mat T[10,1] = r(mu_1)
mat T[10,2] = r(mu_2)
mat T[10,3] = r(mu_1) - r(mu_2)
mat T[10,4] = r(t)
mat T[10,5] = r(p)

ttest  twodem5_first  , by(econ_threat)
mat T[11,1] = r(mu_1)
mat T[11,2] = r(mu_2)
mat T[11,3] = r(mu_1) - r(mu_2)
mat T[11,4] = r(t)
mat T[11,5] = r(p)


ttest  multi  , by(econ_threat)
mat T[12,1] = r(mu_1)
mat T[12,2] = r(mu_2)
mat T[12,3] = r(mu_1) - r(mu_2)
mat T[12,4] = r(t)
mat T[12,5] = r(p)

ttest  newwar  , by(econ_threat)
mat T[13,1] = r(mu_1)
mat T[13,2] = r(mu_2)
mat T[13,3] = r(mu_1) - r(mu_2)
mat T[13,4] = r(t)
mat T[13,5] = r(p)

mat rownames T = "FIRC" "Battle consistency" "Tie" "History of conflict" ///
"Existence at stake"  "Contiguity" "ln(Deaths)" "Initial index" "Initial formalism" ///
"Initial one democracy" "Initial joint democracy"  "Multilateral war" "New war"

	frmttable using ttest.doc, statmat(T) varlabels replace ///
	ctitle("", No econ pressure , Econ pressure, Difference, t-statistic, p-value)

 
 
** MIL PRESSURE

mat T = J(13,5,.)

ttest wernerFIRC , by(mil_threat)
mat T[1,1] = r(mu_1)
mat T[1,2] = r(mu_2)
mat T[1,3] = r(mu_1) - r(mu_2)
mat T[1,4] = r(t)
mat T[1,5] = r(p)

ttest battletide , by(mil_threat)
mat T[2,1] = r(mu_1)
mat T[2,2] = r(mu_2)
mat T[2,3] = r(mu_1) - r(mu_2)
mat T[2,4] = r(t)
mat T[2,5] = r(p)

ttest tie , by(mil_threat) 

mat T[3,1] = r(mu_1)
mat T[3,2] = r(mu_2)
mat T[3,3] = r(mu_1) - r(mu_2)
mat T[3,4] = r(t)
mat T[3,5] = r(p)

ttest cfhist , by(mil_threat)
mat T[4,1] = r(mu_1)
mat T[4,2] = r(mu_2)
mat T[4,3] = r(mu_1) - r(mu_2)
mat T[4,4] = r(t)
mat T[4,5] = r(p)

ttest stakes , by(mil_threat)
mat T[5,1] = r(mu_1)
mat T[5,2] = r(mu_2)
mat T[5,3] = r(mu_1) - r(mu_2)
mat T[5,4] = r(t)
mat T[5,5] = r(p)

ttest contiguity , by(mil_threat)
mat T[6,1] = r(mu_1)
mat T[6,2] = r(mu_2)
mat T[6,3] = r(mu_1) - r(mu_2)
mat T[6,4] = r(t)
mat T[6,5] = r(p)

ttest  lndeaths , by(mil_threat)
mat T[7,1] = r(mu_1)
mat T[7,2] = r(mu_2)
mat T[7,3] = r(mu_1) - r(mu_2)
mat T[7,4] = r(t)
mat T[7,5] = r(p)

ttest  indexnoext_first , by(mil_threat)
mat T[8,1] = r(mu_1)
mat T[8,2] = r(mu_2)
mat T[8,3] = r(mu_1) - r(mu_2)
mat T[8,4] = r(t)
mat T[8,5] = r(p)

ttest  formal_first , by(mil_threat)
mat T[9,1] = r(mu_1)
mat T[9,2] = r(mu_2)
mat T[9,3] = r(mu_1) - r(mu_2)
mat T[9,4] = r(t)
mat T[9,5] = r(p)

ttest  onedem5_first , by(mil_threat)
mat T[10,1] = r(mu_1)
mat T[10,2] = r(mu_2)
mat T[10,3] = r(mu_1) - r(mu_2)
mat T[10,4] = r(t)
mat T[10,5] = r(p)

ttest  twodem5_first , by(mil_threat)
mat T[11,1] = r(mu_1)
mat T[11,2] = r(mu_2)
mat T[11,3] = r(mu_1) - r(mu_2)
mat T[11,4] = r(t)
mat T[11,5] = r(p)


ttest  multi , by(mil_threat)
mat T[12,1] = r(mu_1)
mat T[12,2] = r(mu_2)
mat T[12,3] = r(mu_1) - r(mu_2)
mat T[12,4] = r(t)
mat T[12,5] = r(p)

ttest  newwar , by(mil_threat)
mat T[13,1] = r(mu_1)
mat T[13,2] = r(mu_2)
mat T[13,3] = r(mu_1) - r(mu_2)
mat T[13,4] = r(t)
mat T[13,5] = r(p)

mat rownames T = "FIRC" "Battle consistency" "Tie" "History of conflict" ///
"Existence at stake"  "Contiguity" "ln(Deaths)" "Initial index" "Initial formalism" ///
"Initial one democracy" "Initial joint democracy"  "Multilateral war" "New war"

	frmttable using ttest.doc, statmat(T) varlabels replace ///
	ctitle("", No mil pressure , Mil pressure, Difference, t-statistic, p-value)

	
	
 
*****
*****
***** 
***** Table 3: Marginal effects of third-party pressure on war recurrence


imb  wernerFIRC  battletide_d  tie  cfhist_d stakes contiguity  multi onedem5_first, treatment(diplomat_threat)
cem  wernerFIRC  battletide_d  tie  cfhist_d stakes contiguity  multi onedem5_first, treatment(diplomat_threat)
imb  wernerFIRC  battletide_d  tie  cfhist_d stakes contiguity  multi onedem5_first, treatment(diplomat_threat) useweights


logit newwar diplomat_threat  econ_threat  , cluster(LHRclu)
eststo dip_nested: mfx

logit newwar diplomat_threat econ_threat [iweight = cem_weights]  , cluster(LHRclu)
eststo dip_nested_matched: mfx


logit newwar diplomat_threat econ_threat wernerFIRC  battletide_d  tie  cfhist_d stakes contiguity  multi onedem5_first, cluster(LHRclu)
eststo dip_controls: mfx

logit newwar diplomat_threat econ_threat wernerFIRC  battletide_d  tie  cfhist_d stakes contiguity  multi onedem5_first [iweight = cem_weights], cluster(LHRclu)
eststo dip_controls_matched: mfx



imb  wernerFIRC  battletide_d  tie  cfhist_d stakes contiguity  multi onedem5_first, treatment(dip_only)
cem  wernerFIRC  battletide_d  tie  cfhist_d stakes contiguity  multi onedem5_first, treatment(dip_only)
imb  wernerFIRC  battletide_d  tie  cfhist_d stakes contiguity  multi onedem5_first, treatment(dip_only) useweights


logit newwar dip_only  dip_econ_only  , cluster(LHRclu)
eststo dip_only_nested: mfx

logit newwar dip_only dip_econ_only [iweight = cem_weights]  , cluster(LHRclu)
eststo dip_only_nested_matched: mfx


logit newwar dip_only dip_econ_only wernerFIRC  battletide_d  tie  cfhist_d stakes contiguity  multi onedem5_first, cluster(LHRclu)
eststo dip_only_controls: mfx

logit newwar dip_only dip_econ_only wernerFIRC  battletide_d  tie  cfhist_d stakes contiguity  multi onedem5_first [iweight = cem_weights], cluster(LHRclu)
eststo dip_only_controls_matched: mfx


esttab dip_controls dip_controls_matched dip_only_controls dip_only_controls_matched ///
    using pressure_table3.tex, replace f ///
 	label booktabs margin se(3) eqlabels(none) alignment(S S) collabels("\multicolumn{1}{c}{$\beta$ / SE}") ///
	star(* 0.10 ** 0.05 *** 0.01) pr2 aic bic
	
	

imb  wernerFIRC  battletide_d  tie  cfhist_d stakes contiguity  multi onedem5_first, treatment(econ_threat)
cem  wernerFIRC  battletide_d  tie  cfhist_d stakes contiguity  multi onedem5_first, treatment(econ_threat)
imb  wernerFIRC  battletide_d  tie  cfhist_d stakes contiguity  multi onedem5_first, treatment(econ_threat) useweights


logit newwar diplomat_threat  econ_threat  , cluster(LHRclu)
eststo econ_nested: mfx

logit newwar diplomat_threat econ_threat [iweight = cem_weights]  , cluster(LHRclu)
eststo econ_nested_matched: mfx


logit newwar diplomat_threat econ_threat wernerFIRC  battletide_d  tie  cfhist_d stakes contiguity  multi onedem5_first, cluster(LHRclu)
eststo econ_controls: mfx

logit newwar diplomat_threat econ_threat wernerFIRC  battletide_d  tie  cfhist_d stakes contiguity  multi onedem5_first [iweight = cem_weights], cluster(LHRclu)
eststo econ_controls_matched: mfx



imb  wernerFIRC  battletide_d  tie  cfhist_d stakes contiguity  multi onedem5_first, treatment(dip_econ_only)
cem  wernerFIRC  battletide_d  tie  cfhist_d stakes contiguity  multi onedem5_first, treatment(dip_econ_only)
imb  wernerFIRC  battletide_d  tie  cfhist_d stakes contiguity  multi onedem5_first, treatment(dip_econ_only) useweights


logit newwar dip_only  dip_econ_only  , cluster(LHRclu)
eststo dipecon_only_nested: mfx

logit newwar dip_only dip_econ_only [iweight = cem_weights]  , cluster(LHRclu)
eststo dipecon_only_nested_matched: mfx


logit newwar dip_only dip_econ_only wernerFIRC  battletide_d  tie  cfhist_d stakes contiguity  multi onedem5_first, cluster(LHRclu)
eststo dipecon_only_controls: mfx

logit newwar dip_only dip_econ_only wernerFIRC  battletide_d  tie  cfhist_d stakes contiguity  multi onedem5_first [iweight = cem_weights], cluster(LHRclu)
eststo dipecon_only_contr_matched: mfx



esttab econ_controls econ_controls_matched dipecon_only_controls dipecon_only_contr_matched ///
    using pressure_table3b.tex, replace f ///
 	label booktabs margin se(3) eqlabels(none) alignment(S S) collabels("\multicolumn{1}{c}{$\beta$ / SE}") ///
	star(* 0.10 ** 0.05 *** 0.01) pr2 aic bic	
	
	

*****
*****
***** 
***** Table 4: Cross-tabulation of military pressure and new war in the 24 cases matched with respect to military pressure for peace	
	

imb  wernerFIRC  battletide_d  tie  cfhist_d stakes contiguity  multi onedem5_first, treatment(mil_threat)
cem  wernerFIRC  battletide_d  tie  cfhist_d stakes contiguity  multi onedem5_first, treatment(mil_threat)
imb  wernerFIRC  battletide_d  tie  cfhist_d stakes contiguity  multi onedem5_first, treatment(mil_threat) useweights
	

	tab mil_threat newwar if cem_matched==1	
	

*****
*****
***** 
***** Table 5: Differences in disagreement with settlement by outside pressure for peace
		

 ***** DIP PRESSURE

mat T = J(4,5,.)

ttest diss_first , by(diplomat_threat)
mat T[1,1] = r(mu_1)
mat T[1,2] = r(mu_2)
mat T[1,3] = r(mu_1) - r(mu_2)
mat T[1,4] = r(t)
mat T[1,5] = r(p)

ttest diss_last , by(diplomat_threat)
mat T[2,1] = r(mu_1)
mat T[2,2] = r(mu_2)
mat T[2,3] = r(mu_1) - r(mu_2)
mat T[2,4] = r(t)
mat T[2,5] = r(p)

ttest diss_mean , by(diplomat_threat)
mat T[3,1] = r(mu_1)
mat T[3,2] = r(mu_2)
mat T[3,3] = r(mu_1) - r(mu_2)
mat T[3,4] = r(t)
mat T[3,5] = r(p)

ttest bothdiss_first , by(diplomat_threat)
mat T[4,1] = r(mu_1)
mat T[4,2] = r(mu_2)
mat T[4,3] = r(mu_1) - r(mu_2)
mat T[4,4] = r(t)
mat T[4,5] = r(p)


mat rownames T = "Disagreeing in first yr of cf" "Disagreeing in last yr of cf" "Proportion disagreeing" "Both disagreeing"

	frmttable using ttest.doc, statmat(T) varlabels replace ///
	ctitle("", No pressure , Pressure, Difference, t-statistic, p-value)
	
 ***** ECON PRESSURE

mat T = J(4,5,.)

ttest diss_first , by(econ_threat)
mat T[1,1] = r(mu_1)
mat T[1,2] = r(mu_2)
mat T[1,3] = r(mu_1) - r(mu_2)
mat T[1,4] = r(t)
mat T[1,5] = r(p)

ttest diss_last , by(econ_threat)
mat T[2,1] = r(mu_1)
mat T[2,2] = r(mu_2)
mat T[2,3] = r(mu_1) - r(mu_2)
mat T[2,4] = r(t)
mat T[2,5] = r(p)

ttest diss_mean , by(econ_threat)
mat T[3,1] = r(mu_1)
mat T[3,2] = r(mu_2)
mat T[3,3] = r(mu_1) - r(mu_2)
mat T[3,4] = r(t)
mat T[3,5] = r(p)

ttest bothdiss_first , by(econ_threat)
mat T[4,1] = r(mu_1)
mat T[4,2] = r(mu_2)
mat T[4,3] = r(mu_1) - r(mu_2)
mat T[4,4] = r(t)
mat T[4,5] = r(p)


mat rownames T = "Disagreeing in first yr of cf" "Disagreeing in last yr of cf" "Proportion disagreeing" "Both disagreeing"

	frmttable using ttest.doc, statmat(T) varlabels replace ///
	ctitle("", No pressure , Pressure, Difference, t-statistic, p-value)
 
 ***** MIL PRESSURE


mat T = J(4,5,.)

ttest diss_first , by(mil_threat)
mat T[1,1] = r(mu_1)
mat T[1,2] = r(mu_2)
mat T[1,3] = r(mu_1) - r(mu_2)
mat T[1,4] = r(t)
mat T[1,5] = r(p)

ttest diss_last , by(mil_threat)
mat T[2,1] = r(mu_1)
mat T[2,2] = r(mu_2)
mat T[2,3] = r(mu_1) - r(mu_2)
mat T[2,4] = r(t)
mat T[2,5] = r(p)

ttest diss_mean , by(mil_threat)
mat T[3,1] = r(mu_1)
mat T[3,2] = r(mu_2)
mat T[3,3] = r(mu_1) - r(mu_2)
mat T[3,4] = r(t)
mat T[3,5] = r(p)

ttest bothdiss_first , by(mil_threat)
mat T[4,1] = r(mu_1)
mat T[4,2] = r(mu_2)
mat T[4,3] = r(mu_1) - r(mu_2)
mat T[4,4] = r(t)
mat T[4,5] = r(p)


mat rownames T = "Disagreeing in first yr of cf" "Disagreeing in last yr of cf" "Proportion disagreeing" "Both disagreeing"

	frmttable using ttest.doc, statmat(T) varlabels replace ///
	ctitle("", No pressure , Pressure, Difference, t-statistic, p-value)

	
	


*****
*****
***** 
***** Table 6: Differences in war recurrence by various measures of dissatisfaction
		
mat T = J(4,5,.)

ttest diss_first , by(newwar)
mat T[1,1] = r(mu_1)
mat T[1,2] = r(mu_2)
mat T[1,3] = r(mu_1) - r(mu_2)
mat T[1,4] = r(t)
mat T[1,5] = r(p)

ttest diss_last , by(newwar)
mat T[2,1] = r(mu_1)
mat T[2,2] = r(mu_2)
mat T[2,3] = r(mu_1) - r(mu_2)
mat T[2,4] = r(t)
mat T[2,5] = r(p)

ttest diss_mean , by(newwar)
mat T[3,1] = r(mu_1)
mat T[3,2] = r(mu_2)
mat T[3,3] = r(mu_1) - r(mu_2)
mat T[3,4] = r(t)
mat T[3,5] = r(p)

ttest bothdiss_first , by(newwar)
mat T[4,1] = r(mu_1)
mat T[4,2] = r(mu_2)
mat T[4,3] = r(mu_1) - r(mu_2)
mat T[4,4] = r(t)
mat T[4,5] = r(p)


mat rownames T = "Disagreeing in first yr of cf" "Disagreeing in last yr of cf" "Proportion disagreeing" "Both disagreeing"

	frmttable using ttest.doc, statmat(T) varlabels replace ///
	ctitle("", No new war , New war, Difference, t-statistic, p-value)
		
	
